﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace myMap
{
    public class Intersection
    {
        private String id;
        private int positionX;
        private int positionY;

        private List<RoadSection> outgoings = new List<RoadSection>();
        private List<RoadSection> incomings = new List<RoadSection>();

        public List<RoadSection> GetOutgoings()
        {
            return outgoings;
        }

        public List<RoadSection> GetIncomings()
        {
            return incomings;
        }

        public String ID
        {
            get { return id; }
            set { id = value; }
        }

        public int X
        {
            get { return positionX; }
            set { positionX = value; }
        }

        public int Y
        {
            get { return positionY; }
            set { positionY = value; }
        }

        /// <summary>
        /// 对inter增加outgoing路段
        /// </summary>
        /// <param name="eachRoad"></param>
        public void AddOutgoing(RoadSection eachRoad)
        {
            this.outgoings.Add(eachRoad);
        }


        /// <summary>
        /// 对inter增加incoming路段
        /// </summary>
        /// <param name="eachRoad"></param>
        public void AddIncoming(RoadSection eachRoad)
        {
            this.incomings.Add(eachRoad);
        }
    }
}
